home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS26.ADF
/
HexDump
/
HexParse.mod
< prev
next >
Wrap
Text File
|
1989-01-26
|
1KB
|
60 lines
IMPLEMENTATION MODULE HexParser;
FROM Hex IMPORT CharType;
PROCEDURE LineFeed(ch : CharType; z : CARDINAL): BOOLEAN;
(* Returns TRUE if ch is a line feed. *)
BEGIN
RETURN (ch[z] = CHR(2EH));
END LineFeed;
PROCEDURE IsAlpha(ch : CharType; z : CARDINAL): BOOLEAN;
(* Returns TRUE if ch is a letter between A and F. *)
BEGIN
RETURN (CAP(ch[z]) >= 'A') AND (CAP(ch[z]) <= 'F');
END IsAlpha;
PROCEDURE IsDelimiter(ch : CharType; z : CARDINAL):BOOLEAN;
(* Returns TRUE if ch is a delimiter. *)
VAR
Done : BOOLEAN;
BEGIN
CASE CAP(ch[z]) OF
' ' : Done := TRUE |
'+' : Done := TRUE |
'-' : Done := TRUE |
'/' : Done := TRUE |
'*' : Done := TRUE |
'%' : Done := TRUE |
'^' : Done := TRUE |
'=' : Done := TRUE |
'(' : Done := TRUE |
')' : Done := TRUE |
'$' : Done := TRUE |
',' : Done := TRUE ;
ELSE
Done := FALSE;
END; (* CASE *)
IF Done THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END;
END IsDelimiter;
PROCEDURE IsDigit(ch : CharType; z : CARDINAL): BOOLEAN;
(* Returns TRUE if ch is a digit between 0 and 9. *)
BEGIN
RETURN (CAP(ch[z]) >= '0') AND (CAP(ch[z]) <= '9');
END IsDigit;
END HexParser.